'use strict';

const Controller = require('egg').Controller;

class RoomController extends Controller {
  async createRoom() {
    const { userIds } = this.ctx.request.body;
    this.ctx.body = await this.ctx.service.room.createRoom({ userIds })
  }

  async getRoomList() {
    this.ctx.body = await this.ctx.service.room.getRoomList()
  }

  async getRoomUserList() {
    const { roomId } = this.ctx.request.body;
    this.ctx.body = await this.ctx.service.room.getRoomUserList({ roomId })
  }
}

module.exports = RoomController;
